<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
export default {
  name: 'App',
  created () {
    if (sessionStorage.getItem('userAll')) {
      this.$store.commit('setUser', JSON.parse(sessionStorage.getItem('userAll')))
    }

    // //在页面刷新时将vuex里的信息保存到sessionStorage里
    // window.addEventListener("beforeunload",()=>{
    //    (this.$store.state.user.userAll);
    //   sessionStorage.setItem("store",JSON.stringify(this.$store.state.user.userAll))
    // })
  }
}
</script>

<style lang="less">
.size{
  width: 100%;
  height: 100%;
}
html,body{
  .size;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
#app {
  .size;
}
</style>
